In [1]:
# Seaborn visualization library
import seaborn as sns

import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from pandas import read_excel
from pandas import DataFrame
In [2]:
#****** Running Forecast for Plot 1 *******  Note: Data has been QC-ed

#read Plot 1 data
data = read_excel('../plotData/SkyLine_QC0.xlsx', sheet_name='Flux') #index_col=13, parse_dates=[13]    
In [3]:
plot_file_path="../plotImages/"
In [4]:
data
Out[4]:
QC Plot_ID DailyRep treatment Date pv ghg unit flux r2 nrmse podpu epoch_time DateTime
0 0 7 0 F50 2019-03-26 *** N2O_dry mug -76.9603 0.0782 0.2005 0.7741 1553623830 2019-03-26 18:07:00
1 0 11 0 F75 + Clover 2019-03-26 *** N2O_dry mug -108.6953 0.0852 0.1823 0.7372 1553625601 2019-03-26 18:37:00
2 0 12 0 F100 2019-03-26 *** N2O_dry mug -89.4384 0.0902 0.1720 0.7898 1553626021 2019-03-26 18:44:00
3 0 13 0 F75 2019-03-26 *** N2O_dry mug 70.0648 0.0841 0.1829 0.8564 1553626467 2019-03-26 18:51:00
4 0 14 0 F50 2019-03-26 *** N2O_dry mug -81.0646 0.0641 0.1695 0.7054 1553626891 2019-03-26 18:58:00
... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
36392 0 32 5 F75 + Compost 2019-06-30 *** CO2_dry mg 1073.0730 0.9970 0.0166 0.5670 1561936351 2019-06-30 23:09:00
36393 0 33 5 F50 + Clover 2019-06-30 *** CO2_dry mg 926.1353 0.9879 0.0354 0.4470 1561936770 2019-06-30 23:16:00
36394 0 34 5 F50 2019-06-30 *** CO2_dry mg 612.4387 0.9867 0.0339 0.5861 1561937220 2019-06-30 23:24:00
36395 0 35 5 F50 + Compost 2019-06-30 *** CO2_dry mg 828.4506 0.9956 0.0188 0.6006 1561937641 2019-06-30 23:31:00
36396 0 36 5 Clover 2019-06-30 *** CO2_dry mg 1061.2370 0.9883 0.0328 0.4936 1561938179 2019-06-30 23:38:00

36397 rows × 14 columns

In [5]:
data.columns
Out[5]:
Index(['QC', 'Plot_ID', 'DailyRep', 'treatment', 'Date', 'pv', 'ghg', 'unit',
       'flux', 'r2', 'nrmse', 'podpu', 'epoch_time', 'DateTime'],
      dtype='object')
In [6]:
#Drop columns that are not required
#df.drop(['B', 'C'], axis=1)

data.drop(['QC', 'DailyRep', 'Date', 'pv', 'unit', 'r2', 'nrmse', 'podpu', 'epoch_time'], axis=1, inplace=True)
In [7]:
data
Out[7]:
Plot_ID treatment ghg flux DateTime
0 7 F50 N2O_dry -76.9603 2019-03-26 18:07:00
1 11 F75 + Clover N2O_dry -108.6953 2019-03-26 18:37:00
2 12 F100 N2O_dry -89.4384 2019-03-26 18:44:00
3 13 F75 N2O_dry 70.0648 2019-03-26 18:51:00
4 14 F50 N2O_dry -81.0646 2019-03-26 18:58:00
... ... ... ... ... ...
36392 32 F75 + Compost CO2_dry 1073.0730 2019-06-30 23:09:00
36393 33 F50 + Clover CO2_dry 926.1353 2019-06-30 23:16:00
36394 34 F50 CO2_dry 612.4387 2019-06-30 23:24:00
36395 35 F50 + Compost CO2_dry 828.4506 2019-06-30 23:31:00
36396 36 Clover CO2_dry 1061.2370 2019-06-30 23:38:00

36397 rows × 5 columns

Note: The below cells are for plotting flux per ghg

In [8]:
#Plot the gases separately across all the plots

#Filter out CO2
data_CO2 = data[data['ghg'] == 'CO2_dry']

#Get CH4 and NO2 together
data_CH4_NO2 = data[data['ghg'] != 'CO2_dry']
data_CH4_NO2
Out[8]:
Plot_ID treatment ghg flux DateTime
0 7 F50 N2O_dry -76.9603 2019-03-26 18:07:00
1 11 F75 + Clover N2O_dry -108.6953 2019-03-26 18:37:00
2 12 F100 N2O_dry -89.4384 2019-03-26 18:44:00
3 13 F75 N2O_dry 70.0648 2019-03-26 18:51:00
4 14 F50 N2O_dry -81.0646 2019-03-26 18:58:00
... ... ... ... ... ...
24185 32 F75 + Compost CH4_dry -91.3917 2019-06-30 23:09:00
24186 33 F50 + Clover CH4_dry -73.3762 2019-06-30 23:16:00
24187 34 F50 CH4_dry -57.3759 2019-06-30 23:24:00
24188 35 F50 + Compost CH4_dry -76.3810 2019-06-30 23:31:00
24189 36 Clover CH4_dry -81.5742 2019-06-30 23:38:00

24190 rows × 5 columns

In [9]:
#Plot the gases separately across all the plots  - CH4 and NO2 together (since they are in the same unit) 
# and CO2 separately (since in different unit)
fig, axs = plt.subplots(nrows=2, figsize=(20,12))

#fig, axs = plt.subplots(1,2)

sns.boxenplot("Plot_ID", "flux", "ghg", data_CH4_NO2, ax=axs[0])  #height=8, aspect=2
#set title 
plt.suptitle('Gas Flux across all the plots [1-36] / CH4 and NO2 only', size=22)

sns.boxenplot("Plot_ID", "flux", "ghg", data_CO2, ax=axs[1])
#set title 
plt.suptitle('Gas Flux across all the plots [1-36] / per ghg', size=22)

plt.close(2)
plt.close(3)

#Save boxplot as a file
#output file name  
output_file_name = "../plotImages/allPlots1/AllPlots_gasflux_perghg_catplot.png" 
plot_file_name = plot_file_path + output_file_name

# save as png
plt.savefig(plot_file_name, dpi=80, bbox_inches='tight')

plt.show()

Note: Plotting the flux for each particular greenhouse gas across all 36 plots

In [10]:
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
In [11]:
##plot the different data frames  -  #Plot all data across all the plots - all 3 gases together

##data[data['Plot_ID'] == 1]  boolean indexing

#plt.figure(figsize=(100, 80))  
#plt.suptitle('Gas Flux across all the Plots (1-36) - line plot', color='black', size=75)

#plt.subplot(941)
#plt.xticks(rotation=30, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 1', color='green', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 1]['DateTime'], data[data['Plot_ID'] == 1]['flux'], color='green')

#plt.subplot(942)
#plt.xticks(rotation=30, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 2', color='green', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 2]['DateTime'], data[data['Plot_ID'] == 2]['flux'], color='green')

#plt.subplot(943)
#plt.xticks(rotation=30, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 3', color='green', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 3]['DateTime'], data[data['Plot_ID'] == 3]['flux'], color='green')

#plt.subplot(944)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 4', color='green', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 4]['DateTime'], data[data['Plot_ID'] == 4]['flux'], color='green')

#plt.subplot(945)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 5', color='blue', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 5]['DateTime'], data[data['Plot_ID'] == 5]['flux'], color='blue')

#plt.subplot(946)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 6', color='blue', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 6]['DateTime'], data[data['Plot_ID'] == 6]['flux'], color='blue')

#plt.subplot(947)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 7', color='blue', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 7]['DateTime'], data[data['Plot_ID'] == 7]['flux'], color='blue')

#plt.subplot(948)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 8', color='blue', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 8]['DateTime'], data[data['Plot_ID'] == 8]['flux'], color='blue')

#plt.subplot(949)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 9', color='red', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 9]['DateTime'], data[data['Plot_ID'] == 9]['flux'], color='red')

#plt.subplot(9,4,10)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 10', color='red', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 10]['DateTime'], data[data['Plot_ID'] == 10]['flux'], color='red')

#plt.subplot(9,4,11)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 11', color='red', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 11]['DateTime'], data[data['Plot_ID'] == 11]['flux'], color='red')

#plt.subplot(9,4,12)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 12', color='red', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 12]['DateTime'], data[data['Plot_ID'] == 12]['flux'], color='red')

#plt.subplot(9,4,13)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 13', color='#7F00FF', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 13]['DateTime'], data[data['Plot_ID'] == 13]['flux'], color='#7F00FF')

#plt.subplot(9,4,14)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 14', color='#7F00FF', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 14]['DateTime'], data[data['Plot_ID'] == 14]['flux'], color='#7F00FF')

#plt.subplot(9,4,15)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 15', color='#7F00FF', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 15]['DateTime'], data[data['Plot_ID'] == 15]['flux'], color='#7F00FF')

#plt.subplot(9,4,16)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 16', color='#7F00FF', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 16]['DateTime'], data[data['Plot_ID'] == 16]['flux'], color='#7F00FF')

#plt.subplot(9,4,17)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 17', color='#0066CC', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 17]['DateTime'], data[data['Plot_ID'] == 17]['flux'], color='#0066CC')

#plt.subplot(9,4,18)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 18', color='#0066CC', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 18]['DateTime'], data[data['Plot_ID'] == 18]['flux'], color='#0066CC')

#plt.subplot(9,4,19)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 19', color='#0066CC', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 19]['DateTime'], data[data['Plot_ID'] == 19]['flux'], color='#0066CC')

#plt.subplot(9,4,20)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 20', color='#0066CC', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 20]['DateTime'], data[data['Plot_ID'] == 20]['flux'], color='#0066CC')

#plt.subplot(9,4,21)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 21', color='#CC6600', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 21]['DateTime'], data[data['Plot_ID'] == 21]['flux'], color='#CC6600')

#plt.subplot(9,4,22)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 22', color='#CC6600', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 22]['DateTime'], data[data['Plot_ID'] == 22]['flux'], color='#CC6600')

#plt.subplot(9,4,23)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 23', color='#CC6600', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 23]['DateTime'], data[data['Plot_ID'] == 23]['flux'], color='#CC6600')

#plt.subplot(9,4,24)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 24', color='#CC6600', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 24]['DateTime'], data[data['Plot_ID'] == 24]['flux'], color='#CC6600')

#plt.subplot(9,4,25)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 25', color='#990099', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 25]['DateTime'], data[data['Plot_ID'] == 25]['flux'], color='#990099')

#plt.subplot(9,4,26)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 26', color='#990099', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 26]['DateTime'], data[data['Plot_ID'] == 26]['flux'], color='#990099')

#plt.subplot(9,4,27)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 27', color='#990099', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 27]['DateTime'], data[data['Plot_ID'] == 27]['flux'], color='#990099')

#plt.subplot(9,4,28)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 28', color='#990099', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 28]['DateTime'], data[data['Plot_ID'] == 28]['flux'], color='#990099')

#plt.subplot(9,4,29)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 29', color='#000099', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 29]['DateTime'], data[data['Plot_ID'] == 29]['flux'], color='#000099')

#plt.subplot(9,4,30)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 30', color='#000099', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 30]['DateTime'], data[data['Plot_ID'] == 30]['flux'], color='#000099')

#plt.subplot(9,4,31)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 31', color='#000099', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 31]['DateTime'], data[data['Plot_ID'] == 31]['flux'], color='#000099')

#plt.subplot(9,4,32)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 32', color='#000099', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 32]['DateTime'], data[data['Plot_ID'] == 32]['flux'], color='#000099')

#plt.subplot(9,4,33)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 33', color='#202020', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 33]['DateTime'], data[data['Plot_ID'] == 33]['flux'], color='#202020')

#plt.subplot(9,4,34)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 34', color='#202020', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 34]['DateTime'], data[data['Plot_ID'] == 34]['flux'], color='#202020')

#plt.subplot(9,4,35)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 35', color='#202020', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 35]['DateTime'], data[data['Plot_ID'] == 35]['flux'], color='#202020')

#plt.subplot(9,4,36)
#plt.xticks(rotation=40, ha='right', fontsize=45)
#plt.yticks(fontsize=45)
#plt.title('Plot 36', color='#202020', fontsize=45)
#plt.plot(data[data['Plot_ID'] == 36]['DateTime'], data[data['Plot_ID'] == 36]['flux'], color='#202020')

#plt.tight_layout()

#plt.subplots_adjust(left=0.125,
#                    bottom=0.1, 
#                    right=0.9, 
#                    top=0.9, 
#                    wspace=0.4, 
#                    hspace=0.95)

##Save boxplot as a file
##output file name  
#output_file_name = "../plotImages/allPlots1/AllPlots_gasflux.png" 
#plot_file_name = plot_file_path + output_file_name

## save as png
#plt.savefig(plot_file_name, dpi=100, bbox_inches='tight')

#plt.show()
In [12]:
#plot the different data frames  -  #Plot all data across all the plots (by DATETIME)- N2O_dry

#Filter data to reflect each separate greenhouse gas
data_N2Odry = data[data['ghg'] == 'N2O_dry']

plt.figure(figsize=(100, 80))  
 
plt.suptitle('Gas Flux across all the Plots (1-36) / N2O_dry - line plot', color='black', size=75, fontweight="bold", y=0.98)

plt.subplot(941)
plt.xticks(rotation=30, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 1', color='green', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 1]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 1]['flux'], color='green')

plt.subplot(942)
plt.xticks(rotation=30, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 2', color='green', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 2]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 2]['flux'], color='green')

plt.subplot(943)
plt.xticks(rotation=30, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 3', color='green', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 3]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 3]['flux'], color='green')

plt.subplot(944)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 4', color='green', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 4]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 4]['flux'], color='green')

plt.subplot(945)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 5', color='blue', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 5]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 5]['flux'], color='blue')

plt.subplot(946)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 6', color='blue', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 6]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 6]['flux'], color='blue')

plt.subplot(947)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 7', color='blue', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 7]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 7]['flux'], color='blue')

plt.subplot(948)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 8', color='blue', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 8]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 8]['flux'], color='blue')

plt.subplot(949)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 9', color='red', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 9]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 9]['flux'], color='red')

plt.subplot(9,4,10)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 10', color='red', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 10]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 10]['flux'], color='red')

plt.subplot(9,4,11)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=35)
plt.title('Plot 11', color='red', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 11]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 11]['flux'], color='red')

plt.subplot(9,4,12)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 12', color='red', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 12]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 12]['flux'], color='red')

plt.subplot(9,4,13)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 13', color='#7F00FF', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 13]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 13]['flux'], color='#7F00FF')

plt.subplot(9,4,14)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 14', color='#7F00FF', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 14]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 14]['flux'], color='#7F00FF')

plt.subplot(9,4,15)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 15', color='#7F00FF', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 15]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 15]['flux'], color='#7F00FF')

plt.subplot(9,4,16)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 16', color='#7F00FF', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 16]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 16]['flux'], color='#7F00FF')

plt.subplot(9,4,17)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 17', color='#0066CC', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 17]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 17]['flux'], color='#0066CC')

plt.subplot(9,4,18)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 18', color='#0066CC', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 18]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 18]['flux'], color='#0066CC')

plt.subplot(9,4,19)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 19', color='#0066CC', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 19]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 19]['flux'], color='#0066CC')

plt.subplot(9,4,20)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 20', color='#0066CC', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 20]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 20]['flux'], color='#0066CC')

plt.subplot(9,4,21)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 21', color='#CC6600', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 21]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 21]['flux'], color='#CC6600')

plt.subplot(9,4,22)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 22', color='#CC6600', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 22]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 22]['flux'], color='#CC6600')

plt.subplot(9,4,23)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 23', color='#CC6600', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 23]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 23]['flux'], color='#CC6600')

plt.subplot(9,4,24)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 24', color='#CC6600', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 24]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 24]['flux'], color='#CC6600')

plt.subplot(9,4,25)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 25', color='#990099', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 25]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 25]['flux'], color='#990099')

plt.subplot(9,4,26)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 26', color='#990099', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 26]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 26]['flux'], color='#990099')

plt.subplot(9,4,27)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 27', color='#990099', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 27]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 27]['flux'], color='#990099')

plt.subplot(9,4,28)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 28', color='#990099', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 28]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 28]['flux'], color='#990099')

plt.subplot(9,4,29)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=35)
plt.title('Plot 29', color='#000099', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 29]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 29]['flux'], color='#000099')

plt.subplot(9,4,30)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 30', color='#000099', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 30]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 30]['flux'], color='#000099')

plt.subplot(9,4,31)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 31', color='#000099', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 31]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 31]['flux'], color='#000099')

plt.subplot(9,4,32)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 32', color='#000099', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 32]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 32]['flux'], color='#000099')

plt.subplot(9,4,33)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 33', color='#202020', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 33]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 33]['flux'], color='#202020')

plt.subplot(9,4,34)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 34', color='#202020', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 34]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 34]['flux'], color='#202020')

plt.subplot(9,4,35)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 35', color='#202020', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 35]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 35]['flux'], color='#202020')

plt.subplot(9,4,36)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 36', color='#202020', fontsize=45)
plt.plot(data_N2Odry[data_N2Odry['Plot_ID'] == 36]['DateTime'], data_N2Odry[data_N2Odry['Plot_ID'] == 36]['flux'], color='#202020')

#fig.tight_layout(rect=[0, 0.03, 1, 0.95])

plt.tight_layout()

plt.subplots_adjust(left=0.125,
                    bottom=0.1, 
                    right=0.9, 
                    top=0.9, 
                    wspace=0.4, 
                    hspace=1.45)

#Save boxplot as a file
#output file name  
output_file_name = "../plotImages/allPlots1/AllPlots_gasflux_N2O.png" 
plot_file_name   = plot_file_path + output_file_name

# save as png
plt.savefig(plot_file_name, dpi=100, bbox_inches='tight')

plt.show()
In [13]:
#plot the different data frames  -  #Plot all data across all the plots (by DATETIME)- CH4_dry

#Filter data to reflect each separate greenhouse gas
data_CH4dry = data[data['ghg'] == 'CH4_dry']

plt.figure(figsize=(100, 80))  
plt.suptitle('Gas Flux across all the Plots (1-36) / CH4_dry - line plot', color='black', size=75, fontweight="bold", y=0.98)

plt.subplot(941)
plt.xticks(rotation=30, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 1', color='green', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 1]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 1]['flux'], color='green')

plt.subplot(942)
plt.xticks(rotation=30, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 2', color='green', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 2]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 2]['flux'], color='green')

plt.subplot(943)
plt.xticks(rotation=30, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 3', color='green', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 3]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 3]['flux'], color='green')

plt.subplot(944)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 4', color='green', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 4]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 4]['flux'], color='green')

plt.subplot(945)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 5', color='blue', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 5]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 5]['flux'], color='blue')

plt.subplot(946)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 6', color='blue', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 6]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 6]['flux'], color='blue')

plt.subplot(947)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 7', color='blue', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 7]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 7]['flux'], color='blue')

plt.subplot(948)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 8', color='blue', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 8]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 8]['flux'], color='blue')

plt.subplot(949)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 9', color='red', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 9]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 9]['flux'], color='red')

plt.subplot(9,4,10)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 10', color='red', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 10]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 10]['flux'], color='red')

plt.subplot(9,4,11)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 11', color='red', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 11]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 11]['flux'], color='red')

plt.subplot(9,4,12)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 12', color='red', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 12]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 12]['flux'], color='red')

plt.subplot(9,4,13)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 13', color='#7F00FF', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 13]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 13]['flux'], color='#7F00FF')

plt.subplot(9,4,14)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 14', color='#7F00FF', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 14]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 14]['flux'], color='#7F00FF')

plt.subplot(9,4,15)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 15', color='#7F00FF', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 15]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 15]['flux'], color='#7F00FF')

plt.subplot(9,4,16)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 16', color='#7F00FF', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 16]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 16]['flux'], color='#7F00FF')

plt.subplot(9,4,17)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 17', color='#0066CC', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 17]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 17]['flux'], color='#0066CC')

plt.subplot(9,4,18)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 18', color='#0066CC', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 18]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 18]['flux'], color='#0066CC')

plt.subplot(9,4,19)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 19', color='#0066CC', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 19]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 19]['flux'], color='#0066CC')

plt.subplot(9,4,20)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 20', color='#0066CC', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 20]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 20]['flux'], color='#0066CC')

plt.subplot(9,4,21)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 21', color='#CC6600', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 21]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 21]['flux'], color='#CC6600')

plt.subplot(9,4,22)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 22', color='#CC6600', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 22]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 22]['flux'], color='#CC6600')

plt.subplot(9,4,23)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 23', color='#CC6600', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 23]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 23]['flux'], color='#CC6600')

plt.subplot(9,4,24)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 24', color='#CC6600', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 24]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 24]['flux'], color='#CC6600')

plt.subplot(9,4,25)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 25', color='#990099', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 25]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 25]['flux'], color='#990099')

plt.subplot(9,4,26)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 26', color='#990099', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 26]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 26]['flux'], color='#990099')

plt.subplot(9,4,27)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 27', color='#990099', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 27]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 27]['flux'], color='#990099')

plt.subplot(9,4,28)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 28', color='#990099', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 28]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 28]['flux'], color='#990099')

plt.subplot(9,4,29)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 29', color='#000099', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 29]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 29]['flux'], color='#000099')

plt.subplot(9,4,30)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 30', color='#000099', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 30]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 30]['flux'], color='#000099')

plt.subplot(9,4,31)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 31', color='#000099', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 31]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 31]['flux'], color='#000099')

plt.subplot(9,4,32)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 32', color='#000099', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 32]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 32]['flux'], color='#000099')

plt.subplot(9,4,33)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 33', color='#202020', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 33]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 33]['flux'], color='#202020')

plt.subplot(9,4,34)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 34', color='#202020', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 34]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 34]['flux'], color='#202020')

plt.subplot(9,4,35)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 35', color='#202020', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 35]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 35]['flux'], color='#202020')

plt.subplot(9,4,36)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 36', color='#202020', fontsize=45)
plt.plot(data_CH4dry[data_CH4dry['Plot_ID'] == 36]['DateTime'], data_CH4dry[data_CH4dry['Plot_ID'] == 36]['flux'], color='#202020')


plt.tight_layout()

plt.subplots_adjust(left=0.125,
                    bottom=0.1, 
                    right=0.9, 
                    top=0.9, 
                    wspace=0.4, 
                    hspace=1.45)

#Save boxplot as a file
#output file name  
output_file_name = "../plotImages/allPlots1/AllPlots_gasflux_CH4.png" 
plot_file_name = plot_file_path + output_file_name

# save as png
plt.savefig(plot_file_name, dpi=250, bbox_inches='tight')

plt.show()
In [14]:
#plot the different data frames  -  #Plot all data across all the plots (by DATETIME)- CO2_dry

#Filter data to reflect each separate greenhouse gas
data_CO2dry = data[data['ghg'] == 'CO2_dry']

plt.figure(figsize=(100, 80))  
plt.suptitle('Gas Flux across all the Plots (1-36) / CO2_dry - line plot', color='black', size=75, fontweight="bold", y=0.98)

plt.subplot(941)
plt.xticks(rotation=30, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 1', color='green', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 1]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 1]['flux'], color='green')

plt.subplot(942)
plt.xticks(rotation=30, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 2', color='green', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 2]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 2]['flux'], color='green')

plt.subplot(943)
plt.xticks(rotation=30, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 3', color='green', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 3]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 3]['flux'], color='green')

plt.subplot(944)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 4', color='green', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 4]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 4]['flux'], color='green')

plt.subplot(945)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 5', color='blue', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 5]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 5]['flux'], color='blue')

plt.subplot(946)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 6', color='blue', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 6]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 6]['flux'], color='blue')

plt.subplot(947)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 7', color='blue', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 7]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 7]['flux'], color='blue')

plt.subplot(948)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 8', color='blue', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 8]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 8]['flux'], color='blue')

plt.subplot(949)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 9', color='red', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 9]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 9]['flux'], color='red')

plt.subplot(9,4,10)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 10', color='red', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 10]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 10]['flux'], color='red')

plt.subplot(9,4,11)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 11', color='red', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 11]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 11]['flux'], color='red')

plt.subplot(9,4,12)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 12', color='red', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 12]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 12]['flux'], color='red')

plt.subplot(9,4,13)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 13', color='#7F00FF', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 13]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 13]['flux'], color='#7F00FF')

plt.subplot(9,4,14)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 14', color='#7F00FF', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 14]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 14]['flux'], color='#7F00FF')

plt.subplot(9,4,15)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 15', color='#7F00FF', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 15]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 15]['flux'], color='#7F00FF')

plt.subplot(9,4,16)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 16', color='#7F00FF', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 16]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 16]['flux'], color='#7F00FF')

plt.subplot(9,4,17)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 17', color='#0066CC', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 17]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 17]['flux'], color='#0066CC')

plt.subplot(9,4,18)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 18', color='#0066CC', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 18]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 18]['flux'], color='#0066CC')

plt.subplot(9,4,19)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 19', color='#0066CC', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 19]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 19]['flux'], color='#0066CC')

plt.subplot(9,4,20)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 20', color='#0066CC', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 20]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 20]['flux'], color='#0066CC')

plt.subplot(9,4,21)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 21', color='#CC6600', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 21]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 21]['flux'], color='#CC6600')

plt.subplot(9,4,22)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 22', color='#CC6600', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 22]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 22]['flux'], color='#CC6600')

plt.subplot(9,4,23)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 23', color='#CC6600', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 23]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 23]['flux'], color='#CC6600')

plt.subplot(9,4,24)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 24', color='#CC6600', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 24]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 24]['flux'], color='#CC6600')

plt.subplot(9,4,25)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 25', color='#990099', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 25]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 25]['flux'], color='#990099')

plt.subplot(9,4,26)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 26', color='#990099', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 26]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 26]['flux'], color='#990099')

plt.subplot(9,4,27)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 27', color='#990099', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 27]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 27]['flux'], color='#990099')

plt.subplot(9,4,28)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 28', color='#990099', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 28]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 28]['flux'], color='#990099')

plt.subplot(9,4,29)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 29', color='#000099', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 29]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 29]['flux'], color='#000099')

plt.subplot(9,4,30)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 30', color='#000099', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 30]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 30]['flux'], color='#000099')

plt.subplot(9,4,31)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 31', color='#000099', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 31]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 31]['flux'], color='#000099')

plt.subplot(9,4,32)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 32', color='#000099', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 32]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 32]['flux'], color='#000099')

plt.subplot(9,4,33)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 33', color='#202020', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 33]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 33]['flux'], color='#202020')

plt.subplot(9,4,34)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 34', color='#202020', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 34]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 34]['flux'], color='#202020')

plt.subplot(9,4,35)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 35', color='#202020', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 35]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 35]['flux'], color='#202020')

plt.subplot(9,4,36)
plt.xticks(rotation=40, ha='right', fontsize=45)
plt.yticks(fontsize=45)
plt.title('Plot 36', color='#202020', fontsize=45)
plt.plot(data_CO2dry[data_CO2dry['Plot_ID'] == 36]['DateTime'], data_CO2dry[data_CO2dry['Plot_ID'] == 36]['flux'], color='#202020')

plt.tight_layout()

plt.subplots_adjust(left=0.125,
                    bottom=0.1, 
                    right=0.9, 
                    top=0.9, 
                    wspace=0.4, 
                    hspace=1.45)

#Save boxplot as a file
#output file name  
output_file_name = "../plotImages/allPlots1/AllPlots_gasflux_CO2.png" 
plot_file_name = plot_file_path + output_file_name

# save as png
plt.savefig(plot_file_name, dpi=250, bbox_inches='tight')

plt.show()

Hide code for printing/visualising purposes

In [1]:
from IPython.display import HTML

HTML('''<script>
code_show=true; 
function code_toggle() {
 if (code_show){
 $('div.input').hide();
 } else {
 $('div.input').show();
 }
 code_show = !code_show
} 
$( document ).ready(code_toggle);
</script>
<form action="javascript:code_toggle()"><input type="submit" value="Click here to toggle on/off the raw code."></form>''')
Out[1]:
In [ ]: